vectorimage
Class VectorObject

java.lang.Object
  extended by vectorimage.VectorObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
RAWorldObject

public class VectorObject
extends java.lang.Object
implements java.io.Serializable

Objects for which a GVectorObject can be constructed.

Author:
Steven de Jong, steven.dejong@cs.unimaas.nl
See Also:
Serialized Form

Field Summary
static int OBJ_ELLIPSE
          Ellipsoid object.
static int OBJ_LINE
          Line object.
static int OBJ_RECTANGLE
          Rectangular object.
 
Constructor Summary
VectorObject(int type, java.awt.geom.Rectangle2D.Double bounds, double rotation, java.awt.Color color, boolean filled)
          Construct the shape.
 
Method Summary
 boolean contains(double x, double y)
          See whether this object contains the point given.
 GVectorObject createGVectorObject()
          Create a GVectorObject.
 java.awt.geom.Rectangle2D.Double getBounds()
          Return the bounds of the shape before rotation.
 java.awt.Color getColor()
          Return the colour this object should be drawn in.
 java.awt.geom.Point2D.Double getPosition()
          Get position of this object (the center of the bounds).
 double getRotation()
          Return the rotation of this object in degrees.
 int getType()
          Return the type of object.
 boolean isFilled()
          Return whether to fill or draw this object.
 void setBounds(java.awt.geom.Rectangle2D.Double bounds)
          Set the bounds of the shape before rotation.
 void setPosition(java.awt.geom.Point2D.Double p)
          Set position of this object (the center of the bounds).
 void setRotation(double rotation)
          Set rotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJ_RECTANGLE

public static final int OBJ_RECTANGLE
Rectangular object.

See Also:
Constant Field Values

OBJ_ELLIPSE

public static final int OBJ_ELLIPSE
Ellipsoid object.

See Also:
Constant Field Values

OBJ_LINE

public static final int OBJ_LINE
Line object.

See Also:
Constant Field Values
Constructor Detail

VectorObject

public VectorObject(int type,
                    java.awt.geom.Rectangle2D.Double bounds,
                    double rotation,
                    java.awt.Color color,
                    boolean filled)
Construct the shape.

Method Detail

getType

public int getType()
Return the type of object.


getBounds

public java.awt.geom.Rectangle2D.Double getBounds()
Return the bounds of the shape before rotation.


getPosition

public java.awt.geom.Point2D.Double getPosition()
Get position of this object (the center of the bounds).


setPosition

public void setPosition(java.awt.geom.Point2D.Double p)
Set position of this object (the center of the bounds).


getRotation

public double getRotation()
Return the rotation of this object in degrees.


getColor

public java.awt.Color getColor()
Return the colour this object should be drawn in.


isFilled

public boolean isFilled()
Return whether to fill or draw this object.


setRotation

public void setRotation(double rotation)
Set rotation.


setBounds

public void setBounds(java.awt.geom.Rectangle2D.Double bounds)
Set the bounds of the shape before rotation.


createGVectorObject

public GVectorObject createGVectorObject()
Create a GVectorObject.


contains

public boolean contains(double x,
                        double y)
See whether this object contains the point given.